//
//  HomeHeaderCell.m
//  体育商城
//
//  Created by  on 2022/9/24.
//

#import "HomeHeaderCell.h"
@interface HomeHeaderCell()
@property (strong, nonatomic) IBOutlet UIImageView *IMG;
@property (strong, nonatomic) NSURLSessionTask *task;
@end
@implementation HomeHeaderCell
- (void)setUrl:(NSString *)url{
    if ([_url isEqualToString:url] == NO) {
        _url = url;
        if (self.task) {
            [self.task cancel];
        }
        self.IMG.image = nil;
        self.task = [UIImage imageWithURL:url block:^(UIImage * _Nonnull image) {
            self.IMG.image = image;
        }];
    }
}
@end
